FileChooserWidget: Avoid crash freeing static str
authorDaniel Boles <dboles@src.gnome.org>
Mon, 12 Mar 2018 22:44:37 +0000 (22:44 +0000)
committerDaniel Boles <dboles@src.gnome.org>
Mon, 12 Mar 2018 23:06:21 +0000 (23:06 +0000)
commit9d8fadee976d589645663eade2b83258ed0a005e
tree52380c89c9d2b99e67a4ad840e7972746c125519
parent0e016686838982253b1dc161f4d9df48ce091abd
FileChooserWidget: Avoid crash freeing static str

Having a FileChooserDialog in location-entry mode then pressing
<primary>f to move to search mode would crash with an invalid free().

In that case, FileChooserWidget.get_subtitle() returned a static string
straight from gettext. This crashed when the GBinding from :subtitle to
FileChooserDialog’s HeaderBar:subtitle shortly tried to free the string.

Fix by duplicating the string before returning it, like all other paths.

https://bugzilla.gnome.org/show_bug.cgi?id=791004
gtk/gtkfilechooserwidget.c